package 蓝桥.十二届;

/**
 * @author ZhuYi
 * @create 2025/4/9 19:15
 */
public class B卡片 {
    public static void main(String[] args) {
        int[] card = new int[10];
        for (int i = 0; i < card.length; i++) {
            card[i] = 2021;
        }

        int i = 1;
        while (true) {
            String s = String.valueOf(i);
            String[] str = s.split("");
            for (int j = 0; j < str.length; j++) {
                int n = Integer.parseInt(str[j]);
                if (card[n] > 0) {
                    card[n]--;
                } else {
                    System.out.println(i - 1);
                    return;
                }
            }
            i++;
        }
    }
}
